package demo2;

/**
 * @Author liangzai
 * @Description:
 */
abstract class Person2 {
    public String name;
    public int age;

    public Person2(int age,String name) {
        this.name = name;
        this.age = age;
    }

    public abstract void sayHello();
}

public class Student2 extends Person2{

    public Student2(String name,int age) {
        super(age,name);
    }

    @Override
    public void sayHello() {
        System.out.println(String.format("大家好，我叫%s，今年%d岁，很高兴认识大家", this.name,this.age));
    }

    public static void main(String[] args) {
        Student2 student2 = new Student2("jack",18);
        student2.sayHello();
    }
}
